---
interface Props {
  path: string;
}

const { path } = Astro.props;
---

<div id="vcomments"></div>

<script is:inline src="//unpkg.com/valine/dist/Valine.min.js"></script>

<script>
  new Valine({
    el: '#vcomments',
    appId: 'your-leancloud-app-id',  // 需要在 LeanCloud 创建应用
    appKey: 'your-leancloud-app-key',
    path: window.location.pathname,
    placeholder: '说点什么吧...',
    avatar: 'monsterid',
    meta: ['nick', 'mail'],
    pageSize: 10,
    lang: 'zh-CN',
    highlight: true,
    recordIP: false,
    serverURLs: 'https://your-server-url'  // 如果是国内版 LeanCloud 需要配置
  });
</script>

<style>
  #vcomments {
    margin-top: 2rem;
  }
</style> 